<%@page contentType="text/html" pageEncoding="UTF-8" import="arocms.Constans"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@taglib tagdir="/WEB-INF/tags" prefix="ar" %>

<LINK rel="stylesheet" type="text/css" href="<html:rewrite page="/styles/filesArchive.css"/>">
<html:link action="/Files/Form" styleClass="button">Upload File</html:link> 
<ar:pager collection="<%=Constans.FILE_LIST_PATH%>" pageSize="10" action="/Files/List" parameterName="p"/>

<logic:present name="<%=Constans.FILE_LIST_PATH%>">
    <table class="fileinfo">
        <tr><td></td><td>File name</td> <td>Size [bytes]</td></tr>
        <logic:iterate name="<%=Constans.FILE_LIST_PATH%>" id="file" indexId="ind">
            <tr>
                <td class="tlo${ind%2}">${ind+1}</td>
                <td class="tlo${ind%2}">${file[1]}</td> 
                <td class="tlo${ind%2}">${file[2]}</td>
                <td class="tlo${ind%2}"><a href="<html:rewrite action="/Files/Delete"/>?id=${file[0]}">delete</a></td>
                <td class="tlo${ind%2}"><a href="<html:rewrite action="/Files/Details"/>?id=${file[0]}">details ...</a></td>
            </tr>
        </logic:iterate>
    </table>
</logic:present>